<%@page import="bean.B01boardVO"%>
<%@page import="bean.B01boardDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="./css/B01board.css">
<script src = './js/B01board.js'></script>
</head>
<body>
<%String sess = (String)session.getAttribute("sessionMid"); %>
<jsp:useBean id="vo" class = 'bean.B01boardVO' scope='page'/>
<jsp:setProperty property="*" name="vo"/>
<%
B01boardDTO dto = new B01boardDTO();
dto.setVo(vo);
B01boardVO v = dto.selectOne();

if(dto.review()){
	out.print("<h6>정상적으로 조회수 증가.</h6>");
}else{
	out.print("<h6>조회수 증가 실패.</h6>");
}
%>

<form name = 'hiddenFrm' method="post"> 
	<input type='hidden' name='b_number' value="<%=vo.getB_number()%>"/>
	<input type="hidden" name="nowPage"	value="<%=vo.getNowPage()%>"/>
	<input type="hidden" name='find' value='<%=vo.getFind()%>'/>
	<input type="hidden" name="b_deep" value="<%=vo.getB_deep() %>"/>
	<input type="hidden" name="b_title" value="<%=vo.getB_title() %>"/>
	<input type="hidden" name="b_prno" value="<%=vo.getB_prno()%>"/>
</form>
<h1> 게시판 보기 </h1>
<hr>
	<div class = 'view_title'>
		<div class = 'line' id = 'b_title'><!-- 제목 : --> <%=v.getB_title() %></div>
	</div>	
	<div class="view_elements" >
		<div class = 'line2' id = 'b_modifyDate' >최종수정일 : <%=v.getB_modifyDate()%> </div>
		<div class = 'line2' id = 'b_date'>작성일 : <%=v.getB_date() %> </div>
		<div class = 'line2' id = 'm_id'>글쓴이 : <%=v.getM_id() %></div>
		<div class = 'line2' id = 'b_number'>글번호 : <%=v.getB_number() %> </div>
		<br/>
		<div class = 'line2'>
			<% if(v.getB_image()!= null){%>	
			이미지명: <%=v.getB_image() %> 
			<% }else{%>
			이미지명 : 파일없음
			<% }%>
		</div>
	</div>
	<br/>
	<div style="font-size: small;">
		<%
		if(v.getB_image()!= null) {%>
   		<img src="./memberPhoto_B/<%=v.getB_image()%>" alt="사진" width='200px' height='100px'/>
		<%} %>
	<p/>
		<div ><!-- 내용 : --> <%=v.getB_content() %> </div><br>
	</div>
	
<br>
<hr>
	<div class = 'bottommenu'  align="left">
	<%if(v.getM_id().equals(session.getAttribute("sessionMid")) || 
			session.getAttribute("sessionMid").equals("Sunny")){ %>
		<div><input type ="button" 	value="수정" 		id="btnModify" style="margin-left: 20px"></div>
		<div><input type ="button" 	value="삭제" 		id="btnDelete"></div>
		
	<%}else{%>
		<div><input type ="button" 	value="수정" 		id="btnNotModify" style="margin-left: 20px"></div>
		<div><input type ="button" 	value="삭제" 		id="btnNotDelete"></div>
	<%}%>	
	<%if(session.getAttribute("sessionMid") == null || session.getAttribute("sessionMid").equals("") ){ %>
		<input type="button" value="새 글쓰기" id="btnNotInput" style="margin-right: 1000px;">
	<%}else{ %>
		<input type="button" value="새 글쓰기" id="btnInput"/>
	<%} %>
	<div><input type ="button" 	value="답변달기" 	id="btnReply" style="margin-left: 580px"></div>
	<div><input type ="button" 	value="목록으로" 	id="btnList"></div>
	</div>
	
	<p/>

</body>
<script>viewInit();</script>
</html>

